#ifndef _DATA_H
#define _DATA_H

#include "motor.h"
#include "pid.h"
#include "lpuart_dma.h"
#include "zf_qtimer.h"
#include "imu.h"
#include "camera.h"
#include "iir_filter.h"

extern filter2p_t iir_gyro;
extern motor_t motorfl;
extern motor_t motorfr;
extern motor_t motorbl;
extern motor_t motorbr;

extern pid_increase_t pidfl;
extern pid_increase_t pidfr;
extern pid_increase_t pidbl;
extern pid_increase_t pidbr;

extern pid_position_t pidas;

extern pid_position_t pidcx;
extern pid_position_t pidcy;
extern pid_position_t pidcw;

extern pid_position_t pidyellow;
extern pid_position_t pidyellow_erect;
#define MAG D26

extern imu_t gyro_offset;
extern imu_t gyro;
extern imu_t acc_offset;
extern imu_t acc;
extern imu_t mag;

extern car_t expect_car;
extern car_t present_car;
extern rt_timer_t _2ms_timer;
extern rt_timer_t _10ms_timer;
extern rt_timer_t _5ms_timer;

extern rt_mutex_t iic_mutex;

extern bool test_para;

extern float smotor1ms;
extern float smotor2ms;
extern float smotor3ms;

extern photo_t photo;
extern uint8 A4_thre;
extern uint8 bin_thre;
extern uint8 sobel_thre;

extern rt_event_t smotor_event;

extern CON_t CONV_1;
extern CON_t CONV_2;
extern Target targets;

extern uint8 BinImage[MT9V03X_CSI_H][MT9V03X_CSI_W];
extern uint8 Show_BinImage[MT9V03X_CSI_H][MT9V03X_CSI_W];

extern int erect_cross;
extern float t_round;
extern int x_len,y_len;

#endif